package controllers

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"godemo/models"
	"strconv"
)

type PlayerController struct{}

func (p PlayerController) FindPlayerList(c *gin.Context) {
	activityIdStr := c.PostForm("activityId")
	activityId, _ := strconv.Atoi(activityIdStr)
	players, err := models.FindPlayerList(activityId)
	if err != nil {
		fmt.Println(err)
		ReturnError(c, 0, "没有数据")
		return
	}

	ReturnSuccess(c, 200, "", players, int64(len(players)))
}
